<template>
    <div class="mu-bar">
        <div class="mu-bar-left" @click="leftChange">
            <slot name="left">
                <i class="mu-bar-icon ion ion-chevron-left"></i>
            </slot>
        </div>
        <div class="mu-bar-title" :class="titleClass">
            <slot>
                <span>{{title}}</span>
            </slot>
        </div>
        <div class="mu-bar-right">
            <slot name="right"></slot>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'mu-bar',
        created: function () {
            this.$on('change')
        },
        props: {
            title: {
                type: String,
                default: ''
            },
            titleClass: {
                type: [String, Array, Object]
            }
        },
        methods: {
            leftChange: function (e) {
                this.$emit('on-back')
            }
        }
    }
</script>

<style>

</style>
